<?php

use yii\helpers\Html;
use yii\bootstrap\ActiveForm;

/** @var \Gaolei\YiiRBAC\models\form\Signup $model */

$this->title = '登录';
$fieldOptions1 = [
    'options' => ['class' => 'form-group has-feedback'],
    'inputTemplate' => "{input}<span class='glyphicon glyphicon-envelope form-control-feedback'></span>"
];
$fieldOptions2 = [
    'options' => ['class' => 'form-group has-feedback'],
    'inputTemplate' => "{input}<span class='glyphicon glyphicon-lock form-control-feedback'></span>"
];
?>
<div class="login-box">
    <div class="login-logo">
        <a href="#"><b><?= \Yii::$app->name ?></b></a>
    </div>
    <div class="login-box-body">
        <p class="login-box-msg"><?=$this->title?></p>
        <?php $form = ActiveForm::begin(['id' => 'login-form', 'enableClientValidation' => false]); ?>
        <?= $form->field($model, 'username', $fieldOptions1)->label(false)
            ->textInput(['placeholder' => $model->getAttributeLabel('username')]) ?>
        <?= $form->field($model, 'password', $fieldOptions2)->label(false)
            ->passwordInput(['placeholder' => $model->getAttributeLabel('password')]) ?>
        <div class="row">
            <div class="col-xs-8">
                <?= $form->field($model, 'rememberMe')->checkbox() ?>
            </div>
            <div class="col-xs-4">
                <?= Html::submitButton('登录', ['class' => 'btn btn-primary btn-block btn-flat', 'name' => 'login-button']) ?>
            </div>
        </div>
        <?php ActiveForm::end(); ?>
    </div>
</div>